package com.wit.witmg.api;


import com.wit.witmg.service.ITPatentfeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author bob
 * @since 2024-06-12
 */
@RestController
@RequestMapping("patentfee")
@Api(tags = "专利缴费记录API")
public class PatentfeeController {

    @Resource
    private ITPatentfeeService service;

    @ApiOperation("新建/修改")
    @PostMapping("create")
    public Object create(HttpServletRequest request,
                         @RequestParam(value = "json") String json) {
        return service.create(request,json);
    }

    @ApiOperation("查询")
    @PostMapping("get")
    public Object get(@RequestParam(value = "zid",required = false) Integer zid,
                      @RequestParam(value = "payer",required = false) String payer,
                      @RequestParam(value = "dateS",required = false) String dateS,
                      @RequestParam(value = "dateE",required = false) String dateE
    ) {
        return service.get(zid,payer,dateS,dateE);
    }

    @ApiOperation("删除")
    @PostMapping("del")
    public Object del(@RequestParam("id") int id) {
        return service.del(id);
    }
}
